/**
 * Main Stylesheet - Transformación Digital Madrid
 * Extracted from index.html for better organization
 */

/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f3f2f1;
    color: #323130;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background-color: #fff;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #edebe9;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.logo {
    font-size: 18px;
    font-weight: 600;
    color: #323130;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    height: 40px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.logo span {
    white-space: nowrap;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle {
    background-color: #f3f2f1;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #323130;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background-color: #e1dfdd;
    transform: scale(1.05);
}

.theme-toggle i {
    font-size: 16px;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
    padding: 24px 24px 16px;
    background-color: #faf9f8;
    position: sticky;
    top: 69px;
    z-index: 99;
    flex-shrink: 0;
    border-bottom: 1px solid #edebe9;
    min-height: 80px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.breadcrumb h1 {
    font-size: 28px;
    font-weight: 600;
    color: #323130;
    margin: 0;
    padding: 0;
    display: block;
}

.breadcrumb-nav {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    font-size: 14px;
}

.breadcrumb-nav a {
    color: #0078d4;
    text-decoration: none;
    cursor: pointer;
}

.breadcrumb-nav a:hover {
    text-decoration: underline;
}

.breadcrumb-nav span {
    color: #605e5c;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.main-content::-webkit-scrollbar {
    width: 10px;
}

.main-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.main-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.main-content .container {
    padding: 24px;
}

/* ============================================
   FILE LIST
   ============================================ */
.file-list {
    background-color: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1.6px 3.6px rgba(0, 0, 0, 0.132);
}

.file-list-header {
    display: grid;
    grid-template-columns: 50px 1fr 200px 150px 150px;
    padding: 12px 16px;
    background-color: #faf9f8;
    border-bottom: 1px solid #edebe9;
    font-size: 14px;
    font-weight: 600;
    color: #605e5c;
}

.file-item {
    display: grid;
    grid-template-columns: 50px 1fr 200px 150px 150px;
    padding: 12px 16px;
    border-bottom: 1px solid #edebe9;
    cursor: pointer;
    align-items: center;
    transition: background-color 0.1s;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.file-item:hover {
    background-color: #f3f2f1;
}

.file-item:active {
    background-color: #e1dfdd;
}

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

.file-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-icon i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.file-item:hover .file-icon i {
    transform: scale(1.1);
}

.folder-icon {
    color: #FFB900;
}

.video-icon {
    color: #E74856;
}

.pdf-icon {
    color: #D83B01;
}

.sharing-icon {
    color: #0078d4;
    font-size: 14px;
}

.file-name {
    font-size: 14px;
    color: #323130;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-name a {
    color: #323130;
    text-decoration: none;
}

.file-name a:hover {
    text-decoration: underline;
    color: #0078d4;
}

.file-modified,
.file-size,
.file-sharing {
    font-size: 14px;
    color: #605e5c;
}

.file-sharing {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================
   VIDEO MODAL
   ============================================ */
#video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

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

#video-modal .modal-content {
    width: 90%;
    max-width: 1200px;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

#video-modal .modal-header {
    background-color: #1a1a1a;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
}

#video-modal .modal-header h3 {
    font-size: 16px;
    font-weight: 500;
}

#video-modal .close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    transition: transform 0.2s ease, background-color 0.2s ease;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#video-modal .close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

video {
    width: 100%;
    max-height: 80vh;
    display: block;
    background-color: #000;
}

video::-webkit-media-controls-panel {
    background-color: rgba(0, 0, 0, 0.8);
}

/* ============================================
   BACK BUTTON
   ============================================ */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #fff;
    border: 1px solid #edebe9;
    border-radius: 4px;
    color: #323130;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background-color: #f3f2f1;
    transform: translateX(-4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.back-btn i {
    transition: transform 0.2s ease;
}

.back-btn:hover i {
    transform: translateX(-2px);
}

/* ============================================
   FOOTER - Two Tier Design
   ============================================ */
.footer {
    flex-shrink: 0;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

/* Top Footer - Cities & Social */
.footer-top {
    background-color: #2d2d2d;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.footer-locations {
    font-size: 13px;
    color: #b0b0b0;
    letter-spacing: 0.3px;
}

.footer-social {
    display: flex;
    gap: 8px;
    align-items: center;
}

.footer-social a {
    background-color: #444;
    color: #fff;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
}

.footer-social a:hover {
    background-color: #0078d4;
    transform: translateY(-1px);
}

.footer-social a img {
    width: 16px;
    height: 16px;
}

/* Bottom Footer - Copyright & Email */
.footer-bottom {
    background-color: #1a1a1a;
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.footer-copyright {
    font-size: 12px;
    color: #888;
}

.footer-contact {
    font-size: 12px;
    color: #888;
}

.footer-contact a {
    color: #b0b0b0;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-contact a:hover {
    color: #fff;
}

/* Footer Menu */
.footer-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-menu-link {
    color: #b0b0b0;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
}

.footer-menu-link:hover {
    color: #fff;
}

/* Footer Responsive */
@media (max-width: 768px) {
    .footer-top {
        flex-direction: column;
        text-align: center;
        padding: 12px 16px;
        gap: 12px;
    }

    .footer-locations {
        font-size: 11px;
        line-height: 1.5;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        padding: 10px 16px;
        gap: 6px;
    }

    .footer-menu {
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .footer-locations {
        font-size: 10px;
    }

    .footer-social a {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .footer-copyright,
    .footer-contact {
        font-size: 11px;
    }
}

/* ============================================
   DARK THEME
   ============================================ */
body.dark-theme {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-theme .header {
    background-color: #2d2d2d;
    border-bottom-color: #3d3d3d;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-theme .logo {
    color: #fff;
}

body.dark-theme .theme-toggle {
    background-color: #3d3d3d;
    color: #e0e0e0;
}

body.dark-theme .theme-toggle:hover {
    background-color: #4d4d4d;
}

body.dark-theme .breadcrumb {
    background-color: #2d2d2d;
    border-bottom-color: #3d3d3d;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-theme .breadcrumb h1 {
    color: #e0e0e0;
}

body.dark-theme .breadcrumb-nav a {
    color: #66b3ff;
}

body.dark-theme .breadcrumb-nav span {
    color: #b0b0b0;
}

body.dark-theme .main-content {
    background-color: #2d2d2d;
}

body.dark-theme .main-content::-webkit-scrollbar-track {
    background: #2d2d2d;
}

body.dark-theme .main-content::-webkit-scrollbar-thumb {
    background: #555;
}

body.dark-theme .main-content::-webkit-scrollbar-thumb:hover {
    background: #777;
}

body.dark-theme .container {
    background-color: #2d2d2d;
}

body.dark-theme .file-list {
    background-color: #2d2d2d;
}

body.dark-theme .file-list-header {
    background-color: #3d3d3d;
    border-bottom-color: #4d4d4d;
    color: #b0b0b0;
}

body.dark-theme .file-item {
    border-bottom-color: #3d3d3d;
}

body.dark-theme .file-item:hover {
    background-color: #3d3d3d;
}

body.dark-theme .file-name {
    color: #e0e0e0;
}

body.dark-theme .file-name a {
    color: #e0e0e0;
}

body.dark-theme .file-modified,
body.dark-theme .file-size,
body.dark-theme .file-sharing {
    color: #b0b0b0;
}

body.dark-theme .back-btn {
    background-color: #3d3d3d;
    border-color: #4d4d4d;
    color: #e0e0e0;
}

body.dark-theme .back-btn:hover {
    background-color: #4d4d4d;
}

body.dark-theme .footer {
    background-color: #0d0d0d;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-theme .footer-social a {
    background-color: #3d3d3d;
}

body.dark-theme .footer-social a:hover {
    background-color: #5d5d5d;
}

/* ============================================
   TABLET STYLES
   ============================================ */
@media (max-width: 1024px) {
    .file-list-header,
    .file-item {
        grid-template-columns: 40px 1fr 120px 100px;
    }

    .file-sharing {
        display: none;
    }

    .container {
        padding: 16px;
    }

    .breadcrumb {
        padding: 20px 16px;
    }

    .breadcrumb h1 {
        font-size: 24px;
    }

    .breadcrumb-nav {
        margin-top: 10px;
    }
}

/* ============================================
   MOBILE STYLES
   ============================================ */
@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
        flex-wrap: wrap;
        top: 0;
    }

    .logo {
        font-size: 14px;
    }

    .logo img {
        height: 30px;
    }

    .header-actions {
        gap: 8px;
    }

    .theme-toggle {
        padding: 8px 12px;
        font-size: 12px;
    }

    .breadcrumb {
        padding: 16px;
        top: 57px;
        min-height: 70px;
    }

    .breadcrumb h1 {
        font-size: 20px;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }

    .breadcrumb-nav {
        font-size: 12px;
        margin-top: 8px;
    }

    .main-content::-webkit-scrollbar {
        width: 6px;
    }

    .container {
        padding: 12px;
    }

    .file-list-header {
        display: none;
    }

    .file-item {
        grid-template-columns: 40px 1fr 80px;
        padding: 16px 12px;
        gap: 12px;
    }

    .file-icon {
        font-size: 20px;
    }

    .file-name {
        font-size: 13px;
        white-space: normal;
        line-height: 1.4;
    }

    .file-modified {
        display: none;
    }

    .file-sharing {
        display: none;
    }

    .file-size {
        font-size: 12px;
        text-align: right;
    }

    .back-btn {
        padding: 10px 16px;
        font-size: 13px;
        width: 100%;
        justify-content: center;
    }

    #video-modal {
        padding: 10px;
    }

    #video-modal .modal-content {
        width: 100%;
        max-width: 100%;
    }

    #video-modal .modal-header {
        padding: 12px 16px;
    }

    #video-modal .modal-header h3 {
        font-size: 14px;
    }

    video {
        max-height: 60vh;
    }

    .footer {
        flex-direction: column;
        text-align: center;
        padding: 20px 16px;
    }

    .footer-locations,
    .footer-contact {
        font-size: 12px;
    }

    .footer-social {
        order: -1;
        margin-bottom: 15px;
    }

    .footer-social a {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

/* ============================================
   SMALL MOBILE STYLES
   ============================================ */
@media (max-width: 480px) {
    .header {
        gap: 8px;
    }

    .logo {
        gap: 8px;
        flex: 1;
        min-width: 0;
    }

    .logo img {
        height: 28px;
        flex-shrink: 0;
    }

    .theme-toggle span {
        display: none;
    }

    .theme-toggle {
        padding: 8px;
        width: 36px;
        height: 36px;
        justify-content: center;
        flex-shrink: 0;
    }

    .breadcrumb {
        padding: 12px;
        top: 53px;
        min-height: 65px;
    }

    .breadcrumb h1 {
        font-size: 18px;
        word-break: break-word;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }

    .breadcrumb-nav {
        margin-top: 6px;
    }

    .main-content::-webkit-scrollbar {
        width: 4px;
    }

    .file-item {
        grid-template-columns: 36px 1fr 70px;
        padding: 12px 8px;
        gap: 8px;
    }

    .file-name {
        font-size: 12px;
        word-break: break-word;
        min-width: 0;
    }

    .file-size {
        font-size: 11px;
        white-space: nowrap;
    }

    .footer-locations {
        font-size: 10px;
    }

    .footer-social {
        gap: 10px;
    }

    .footer-social a {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .footer-contact {
        font-size: 11px;
        word-break: break-all;
    }
}

/* ============================================
   TOUCH DEVICE IMPROVEMENTS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .file-item {
        padding: 16px 12px;
        min-height: 60px;
    }

    .back-btn,
    .theme-toggle,
    .footer-social a {
        min-height: 44px;
        min-width: 44px;
    }

    .close-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ============================================
   LANDSCAPE MOBILE
   ============================================ */
@media (max-width: 768px) and (orientation: landscape) {
    video {
        max-height: 70vh;
    }

    .breadcrumb h1 {
        font-size: 18px;
    }
}

/* ============================================
   UPLOAD LOADER STYLES
   ============================================ */
.upload-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;
}

.upload-loader-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #0078d4;
    font-size: 14px;
    font-weight: 500;
}

.upload-loader-spinner i {
    font-size: 24px;
}

.upload-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    color: #0078d4;
    font-size: 14px;
    font-weight: 500;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
}

.upload-loader i {
    font-size: 20px;
}

/* Dark theme support */
.dark-theme .upload-loader-overlay {
    background: rgba(30, 30, 30, 0.9);
}

.dark-theme .upload-loader-spinner {
    color: #60cdff;
}

.dark-theme .upload-loader {
    background: #2d2d2d;
    border-color: #444;
    color: #60cdff;
}
