/* Yrityshakemisto Frontend Styles */

/* Container Styles */
#yrityshakemisto-container {
    margin: 20px 0;
}

/* Filter Styles */
.yrityshakemisto-filters {
    /*background: #f8f9fa;*/
    /*padding: 20px;*/
    border-radius: 8px;
    margin-bottom: 30px;
}

.company-filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
}

.search-field,
.filter-field {
    flex: 1;
    min-width: 200px;
}

.search-field input,
.filter-field select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filter-submit {
    display: flex;
    gap: 10px;
}

.filter-submit button,
.filter-submit a {
    padding: 10px 20px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.filter-submit a.submit-company-btn {
    background: #00a32a;
    color: white;
    font-weight: 500;
}

.filter-submit button:hover,
.filter-submit a:hover {
    background: #005a87;
}

.filter-submit a.submit-company-btn:hover {
    background: #007c20;

    cursor: pointer;
    font-size: 14px;
}

.filter-submit a {
    background: #666;
    color: white !important;
}

.filter-submit button:hover,
.filter-submit a:hover {
    opacity: 0.8;
}

/* Company List Styles */
.companies-list {
    display: grid;
    gap: 20px;
}

/* Grid Layout */
.layout-grid .companies-list {
    grid-template-columns: repeat(1, 1fr);
}

/* Responsive Grid Breakpoints */
@media (max-width: 1920px) {
    .layout-grid .companies-list {
        grid-template-columns: repeat(1, 1fr);
    }
}

@media (max-width: 1366px) {
    .layout-grid .companies-list {
        grid-template-columns: repeat(1, 1fr);
    }
}

@media (max-width: 768px) {
    .layout-grid .companies-list {
        grid-template-columns: repeat(1, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .layout-grid .companies-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* List Layout */
.layout-list .companies-list {
    grid-template-columns: 1fr;
}

/* Company Item Styles */
.company-item {
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s ease;
    cursor: pointer;
}

.company-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.company-item.payment-paid {
    border-left: 10px solid #28a745;
    border-bottom: 2px solid #28a745;
    border-top: 2px solid #28a745;
    border-right: 2px solid #28a745;
}

.company-item.payment-free {
    border-left: 4px solid #6c757d;
}

.company-item.expanded {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Company Summary (always visible) */
.company-summary {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.company-basic-info {
    flex: 1;
}

/* Company Logo in summary */
.company-logo {
    flex: 0 0 60px;
    text-align: center;
}

.company-logo img {
    max-width: 60px;
    height: auto;
    border-radius: 4px;
}

/* Company Content */
.company-name {
    margin: 0 0 8px 0 !important;
    font-size: 1.3em;
    font-weight: bold;
    color: #0073aa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color 0.3s ease;
}

.company-name:hover {
    color: #005a87;
}

.expandable-trigger {
    user-select: none;
}

.expand-icon {
    font-size: 0.8em;
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.company-industries {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 8px;
    font-style: italic;
}

.company-short-description {
    margin-bottom: 10px;
}

.company-short-description p {
    margin: 0;
    color: #555;
    line-height: 1.4;
    font-size: 0.95em;
}

.company-city {
    font-size: 0.9em;
    color: #0073aa;
    font-weight: 500;
    margin-top: 5px;
}

.company-city-detail {
    margin-bottom: 8px;
}

.company-city-detail strong {
    display: inline-block;
    min-width: 100px;
    color: #333;
}

/* Company Details (expandable) */
.company-details {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.company-logo-large {
    text-align: center;
    margin-bottom: 20px;
}

.company-logo-large img {
    max-width: 150px;
    height: auto;
    border-radius: 8px;
}

.company-details h4 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.company-description {
    margin-bottom: 20px;
    color: #444;
    line-height: 1.6;
}

/* Contact Information */
.company-contact {
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.company-contact > div {
    margin-bottom: 8px;
}

.company-contact strong {
    display: inline-block;
    min-width: 80px;
    color: #333;
}

.company-contact a {
    color: #0073aa;
    text-decoration: none;
}

.company-contact a:hover {
    text-decoration: underline;
}

/* Social Links */
.company-social .social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}

.social-link {
    display: inline-block;
    padding: 4px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 0.8em;
    text-decoration: none !important;
    color: #333 !important;
}

.social-link:hover {
    background: #e0e0e0;
}

.social-facebook { background-color: #3b5998; color: white !important; }
.social-twitter { background-color: #1da1f2; color: white !important; }
.social-linkedin { background-color: #0077b5; color: white !important; }
.social-instagram { background-color: #e4405f; color: white !important; }

/* List Layout Specific Styles */
.list-layout.company-item .company-summary {
    align-items: center;
}

.list-layout .company-logo {
    flex: 0 0 80px;
}

.list-layout .company-logo img {
    max-width: 80px;
}

.list-layout .company-name {
    font-size: 1.2em;
}

.list-layout .company-short-description p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Detailed Layout */
.detailed-layout.company-item {
    max-width: none;
    padding: 30px;
}

.detailed-layout .company-logo img {
    max-width: 200px;
}

.detailed-layout .company-name {
    font-size: 2em;
    margin-bottom: 15px;
}

/* Pagination */
.pagination {
    text-align: center;
    margin-top: 30px;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    background: white;
    border: 1px solid #ddd;
    color: #0073aa;
    text-decoration: none;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: #0073aa;
    color: white;
}

/* No Companies Message */
.no-companies {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Form Styles */
#yrityshakemisto-form-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 30px;
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.3);
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    color: #666;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

fieldset {
    border: 1px solid #e1e1e1;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

fieldset legend {
    padding: 0 10px;
    font-weight: bold;
    color: #333;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
}

.btn:hover {
    background: #005a87;
}

.btn-primary {
    background: #0073aa;
}

/* Form Messages */
#form-messages {
    margin-top: 20px;
}

.success-message {
    padding: 15px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
}

.error-message {
    padding: 15px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

.loading {
    padding: 15px;
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .company-filters-form {
        flex-direction: column;
    }
    
    .search-field,
    .filter-field {
        min-width: auto;
    }
    
    .layout-grid .companies-list {
        grid-template-columns: 1fr;
    }
    
    .list-layout.company-item {
        flex-direction: column;
    }
    
    .list-layout .company-logo {
        flex: none;
        text-align: center;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    #yrityshakemisto-form-container {
        margin: 10px;
        padding: 20px;
    }
}

/* Industries Browser Styles */
.industries-browser {
    margin: 20px 0;
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
}

.industries-browser h3 {
    margin: 0 0 25px 0;
    color: #333;
    font-size: 24px;
    text-align: center;
}

.industries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.industry-item {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.industry-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: #0073aa;
}

.industry-main .industry-link {
    text-decoration: none;
    color: inherit;
    display: block;
    margin-bottom: 10px;
}

.industry-main .industry-link:hover h4 {
    color: #0073aa;
}

.industry-item h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.industry-item .company-count {
    color: #666;
    font-size: 14px;
    font-weight: normal;
}

.industry-description {
    margin: 10px 0 0 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.sub-industries {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e1e5e9;
}

.sub-industries h5 {
    margin: 0 0 10px 0;
    color: #555;
    font-size: 14px;
    font-weight: 600;
}

.sub-industries-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sub-industries-list li {
    margin: 0;
}

.sub-industries-list a {
    display: inline-block;
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 20px;
    text-decoration: none;
    color: #555;
    font-size: 13px;
    transition: all 0.3s ease;
}

.sub-industries-list a:hover {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.sub-industries-list .company-count {
    color: #888;
    font-size: 12px;
}

.sub-industries-list a:hover .company-count {
    color: #ccc;
}

/* No companies message when filtered */
.no-companies {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.no-companies p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 16px;
}

.no-companies a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.no-companies a:hover {
    text-decoration: underline;
}

/* Responsive adjustments for industries */
@media (max-width: 768px) {
    .industries-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .industry-item {
        padding: 15px;
    }
    
    .industries-browser {
        padding: 20px;
    }
    
    .sub-industries-list {
        gap: 6px;
    }
    
    .sub-industries-list a {
        padding: 5px 10px;
        font-size: 12px;
    }
}