/* =========================================
   Component-Specific Styles
   ========================================= */

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--white);
    margin: auto;
    padding: 0;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-xl);
    animation: slideIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: var(--spacing-md);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: var(--white);
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.modal-close:hover {
    transform: rotate(90deg);
}

.modal-body {
    padding: var(--spacing-md);
}

.modal-footer {
    padding: var(--spacing-md);
    background-color: var(--gray-100);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

/* Contact Form in Modal */
.contact-form-modal .form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
}

.contact-form-modal .form-group-full {
    grid-column: 1 / -1;
}

.form-required {
    color: #dc3545;
}

.form-help {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-top: var(--spacing-xs);
}

/* Date and Time Picker Styling */
input[type="date"],
input[type="time"] {
    cursor: pointer;
}

/* Portfolio Cards */
.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.portfolio-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.portfolio-item:hover .portfolio-image {
    transform: scale(1.05);
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 102, 204, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-info {
    padding: var(--spacing-md);
}

.portfolio-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xs);
    color: var(--dark-color);
}

.portfolio-category {
    color: var(--gray-600);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.portfolio-tech {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
}

.tech-tag {
    background-color: var(--gray-100);
    color: var(--gray-700);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

/* Service Cards */
.service-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border-top: 4px solid var(--primary-color);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-top-color: var(--accent-color);
}

.service-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--white);
    margin-bottom: var(--spacing-md);
}

.service-title {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
    color: var(--dark-color);
}

.service-description {
    color: var(--gray-600);
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
}

.service-features {
    list-style: none;
    margin-bottom: var(--spacing-md);
}

.service-features li {
    padding: var(--spacing-xs) 0;
    color: var(--gray-700);
    display: flex;
    align-items: flex-start;
}

.service-features li::before {
    content: "✓";
    color: var(--primary-color);
    font-weight: bold;
    margin-right: var(--spacing-xs);
    font-size: 1.2rem;
}

/* About Section Styles */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: center;
}

.about-content h2 {
    margin-bottom: var(--spacing-md);
}

.about-content p {
    margin-bottom: var(--spacing-sm);
    line-height: 1.7;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.stat-item {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--gray-100);
    border-radius: var(--radius-md);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    color: var(--gray-600);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Contact Page Specific */
.contact-page-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
}

.contact-info-section {
    background: var(--gray-100);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--gray-300);
}

.contact-info-item:last-child {
    border-bottom: none;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--spacing-sm);
    flex-shrink: 0;
}

.contact-details h3 {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-xs);
}

.contact-details p {
    color: var(--gray-600);
    margin: 0;
}

.contact-details a {
    color: var(--primary-color);
    font-weight: 500;
}

/* Map Container */
.map-container {
    width: 100%;
    height: 400px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-top: var(--spacing-lg);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Thank You Page */
.thank-you-container {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    padding: var(--spacing-xl) 0;
}

.thank-you-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-lg);
    font-size: 3rem;
    color: var(--white);
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.thank-you-content h1 {
    margin-bottom: var(--spacing-md);
    color: var(--dark-color);
}

.thank-you-message {
    font-size: 1.125rem;
    color: var(--gray-600);
    margin-bottom: var(--spacing-lg);
    line-height: 1.7;
}

.next-steps {
    background: var(--gray-100);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    margin: var(--spacing-lg) 0;
    text-align: left;
}

.next-steps h3 {
    margin-bottom: var(--spacing-md);
}

.next-steps ol {
    margin-left: var(--spacing-md);
    color: var(--gray-700);
}

.next-steps li {
    margin-bottom: var(--spacing-sm);
    line-height: 1.7;
}

/* Legal Pages Styles */
.legal-content {
    max-width: 900px;
    margin: 0 auto;
}

.legal-content h1 {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 3px solid var(--primary-color);
}

.legal-content h2 {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
}

.legal-content h3 {
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.legal-content p {
    margin-bottom: var(--spacing-sm);
    line-height: 1.8;
}

.legal-content ul,
.legal-content ol {
    margin-left: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.legal-content li {
    margin-bottom: var(--spacing-xs);
    line-height: 1.7;
}

.last-updated {
    font-style: italic;
    color: var(--gray-600);
    margin-bottom: var(--spacing-lg);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    list-style: none;
    padding: var(--spacing-sm) 0;
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.breadcrumb li {
    color: var(--gray-600);
}

.breadcrumb li:not(:last-child)::after {
    content: "/";
    margin: 0 var(--spacing-xs);
}

.breadcrumb a {
    color: var(--primary-color);
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    text-align: center;
    color: var(--gray-600);
    margin-top: var(--spacing-sm);
}

/* Alert/Notification */
.alert {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: flex-start;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    z-index: 1000;
}

.back-to-top.visible {
    display: flex;
}

.back-to-top:hover {
    background: var(--accent-color);
    transform: translateY(-5px);
}

/* Mobile Specific Component Adjustments */
@media (max-width: 767px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: var(--spacing-sm);
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: var(--spacing-sm);
    }
    
    .contact-form-modal .form-row {
        grid-template-columns: 1fr;
    }
    
    .about-grid,
    .contact-page-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .about-stats {
        grid-template-columns: 1fr;
    }
    
    .portfolio-image {
        height: 200px;
    }
    
    .map-container {
        height: 300px;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }
    
    .service-card {
        padding: var(--spacing-md);
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}