@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #3b82f6;
    --background-color: #f8fafc;
    --text-color: #1e293b;
    --card-background: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --border-color: #e2e8f0;
    --accent-color: #f59e0b;
    --success-color: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 4rem 0;  /* Increased padding from 3rem to 4rem */
    margin-bottom: 4rem;  /* Increased margin from 3rem to 4rem */
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.1) 0%, transparent 60%);
}

.header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.header h2 {
    font-size: 1.5rem;
    font-weight: 500;
    opacity: 0.9;
    max-width: 600px;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2rem;
    padding: 1rem 0 3rem;
}

.document-card {
    background-color: var(--card-background);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px var(--shadow-color),
                0 1px 3px var(--shadow-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    position: relative;
}

.document-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15),
                0 4px 6px rgba(0, 0, 0, 0.1);
}

.document-header {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.25rem;
    position: relative;
}

.document-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.document-header h3::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z'%3E%3C/path%3E%3C/svg%3E");
    opacity: 0.9;
}

.document-preview {
    padding: 1.5rem;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
}

.preview-image {
    width: 100%;
    height: 200px;
    background-color: #f1f5f9;
    background-size: cover;
    background-position: center;
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    position: relative;
    overflow: hidden;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;  /* This ensures the image covers the container properly */
    object-position: center;  /* Centers the image within the container */
    transition: transform 0.3s ease;  /* Smooth transition for hover effect */
}

.preview-image:hover img {
    transform: scale(1.05);  /* Slight zoom effect on hover */
}

.preview-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.1));
    pointer-events: none;  /* Ensures the overlay doesn't interfere with image interactions */
}

.preview-content {
    color: #475569;
}

.preview-content p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.6;
}

.preview-content ul {
    list-style: none;
    padding-left: 1.5rem;
}

.preview-content li {
    position: relative;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.preview-content li::before {
    content: '•';
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: -1.5rem;
}

.document-actions {
    padding: 1.25rem;
    background-color: #f8fafc;
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--secondary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    flex: 1;
    text-decoration: none;
    gap: 0.5rem;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-preview {
    background-color: #64748b;
}

.btn-preview:hover {
    background-color: #475569;
}

.btn::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-size: contain;
}

.btn-preview::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z'/%3E%3C/svg%3E");
}

.btn:not(.btn-preview)::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4'/%3E%3C/svg%3E");
}

footer {
    background: var(--primary-color);
    color: white;
    padding: 4rem 2rem 1rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: white;
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
    margin: 0.5rem 0;
}

.footer-section a:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-link {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
}

.social-link:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.9rem;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 2rem auto;
    padding: 1.5rem;
    width: 95%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
                0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #e2e8f0;
    transform: scale(1.1);
}

.modal-close::before,
.modal-close::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 2px;
    background-color: #64748b;
    transform: rotate(45deg);
}

.modal-close::after {
    transform: rotate(-45deg);
}

.modal-body {
    padding: 1rem;
}

.preview-frame {
    width: 100%;
    height: 75vh;
    border: none;
    border-radius: 0.5rem;
    background-color: #f8fafc;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
    .header {
        padding: 3rem 0;  /* Adjusted for mobile */
    }

    .header h1 {
        font-size: 2rem;
    }

    .header h2 {
        font-size: 1.25rem;
    }

    .documents-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1rem;
    }

    .document-card {
        margin: 0 0.5rem;
    }

    .preview-image {
        height: 180px;
    }

    .document-actions {
        flex-direction: column;
    }

    .modal-content {
        margin: 1rem;
        padding: 1rem;
    }

    .preview-frame {
        height: 60vh;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}

.btn.loading {
    position: relative;
    opacity: 0.8;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}