/* ========================================
   OptiFilm - Estilos Globales
   Optimizado para iPad 10-13"
   ======================================== */

/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    height: 100%;
}

body {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

/* Main ocupa el espacio restante */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
}

/* Footer siempre visible al final */
footer {
    flex-shrink: 0;
    width: 100%;
}

/* Prevenir scroll horizontal */
.container-fluid {
    max-width: 100vw;
    overflow-x: hidden;
    overflow-y: auto;
    flex: 1;
    display: flex;
    width: 100%;
}

.row {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Navbar Styles - Optimizado para iPad */
.navbar-custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    min-height: 70px;
}

.navbar-custom .navbar-brand {
    font-size: 2rem;
    font-weight: 700;
    color: white !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-logo-svg {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}

.navbar-custom .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    font-size: 1.1rem;
    margin: 0 8px;
    transition: all 0.3s;
    border-radius: 8px;
    padding: 10px 20px !important;
}

.navbar-custom .nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
    transform: translateY(-2px);
}

.navbar-custom .nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    color: white !important;
}

.btn-dark-mode {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 1.1rem;
}

.btn-dark-mode:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
    transform: scale(1.05);
}

/* Home Page Styles - iPad optimizado */
.sidebar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    overflow-y: auto;
    padding: 12px;
    color: white;
}

.sidebar h4 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.sidebar-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    transition: transform 0.2s;
}

.sidebar-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-card h5 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.sidebar-card p {
    font-size: 0.9rem;
}

.main-content {
    padding: 15px 12px;
    background-color: #f8f9fa;
    height: 100%;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 50px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.brand-title {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 30px;
}

.datetime-display {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 30px;
}

.form-label {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.form-control-lg {
    font-size: 1.2rem;
    padding: 15px 20px;
    border-radius: 10px;
}

.form-check {
    font-size: 1.1rem;
}

.btn-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 15px;
    font-weight: 600;
    font-size: 1.2rem;
    border-radius: 10px;
    transition: all 0.3s;
}

.btn-login:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.anuncio-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.95rem;
    margin-bottom: 10px;
    display: inline-block;
}

/* Hero Section Styles */
.hero-section {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 8px;
    overflow-y: auto;
    max-height: 100%;
}

.hero-logo {
    width: 160px;
    height: 160px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
}

.hero-logo-svg {
    width: 160px;
    height: 160px;
    filter: drop-shadow(0 8px 20px rgba(102, 126, 234, 0.22));
}

.film-roll {
    fill: url(#rollGradient);
    stroke: #c5c9e8;
    stroke-width: 2.5;
}

.film-sheet {
    fill: url(#sheetGradient);
    opacity: 0.88;
    transform-origin: 50px 70px;
    animation: unrollFilm 2.6s ease-in-out infinite alternate;
}

.film-edge-line {
    stroke: url(#edgeGradient);
    stroke-width: 1.2;
    fill: none;
    opacity: 0.75;
}

.film-cap {
    fill: #9ea3c8;
}

.film-core {
    fill: url(#coreGradient);
}

.film-highlight {
    fill: rgba(255,255,255,0.5);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes unrollFilm {
    0% { transform: scaleX(0.48); opacity: 0.85; }
    100% { transform: scaleX(1); opacity: 1; }
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.hero-description {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
    max-width: 700px;
    margin: 0 auto 10px;
}

.stats-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.stat-item {
    text-align: center;
    padding: 6px;
}

.stat-icon {
    font-size: 1.5rem;
    color: #667eea;
    margin-bottom: 3px;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.btn-cta {
    font-size: 0.95rem;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
}

.trusted-by {
    text-align: center;
    margin-top: 8px;
}

.trusted-by p {
    font-size: 0.8rem;
    margin-bottom: 6px !important;
}

.company-badge {
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 10px;
    border-radius: 25px;
    font-weight: 600;
    color: #667eea;
    font-size: 0.75rem;
    display: inline-block;
    margin: 0 2px;
}

/* Dark mode para hero section */
body.dark-mode .hero-subtitle {
    color: #eee;
}

body.dark-mode .hero-description {
    color: #ccc;
}

body.dark-mode .stat-label {
    color: #aaa;
}

body.dark-mode .company-badge {
    background: rgba(102, 126, 234, 0.2);
    color: #a8b5ff;
}

/* Footer Styles - iPad optimizado - Sin scroll */
footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.1);
    width: 100%;
}

footer .container {
    padding: 0;
}

.footer-section h5 {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.footer-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s;
    display: block;
    padding: 3px 0;
    font-size: 0.85rem;
}

.footer-link:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 10px;
    margin-top: 10px;
    text-align: center;
    font-size: 0.8rem;
}

.company-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    font-size: 0.85rem;
}

.company-info p {
    margin-bottom: 4px;
    line-height: 1.3;
}

.social-icon {
    color: white;
    font-size: 1.3rem;
    margin: 0 8px;
    transition: transform 0.3s;
}

.social-icon:hover {
    transform: translateY(-5px);
}

/* Productos Page - iPad optimizado */
.card {
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    margin-bottom: 25px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.card-title {
    font-size: 1.4rem;
    font-weight: 600;
}

.card-text {
    font-size: 1.1rem;
}

/* Dark Mode Styles */
body.dark-mode {
    background-color: #1a1a2e;
    color: #eee;
}

body.dark-mode .main-content {
    background-color: #16213e;
}

body.dark-mode .login-card {
    background: #0f3460;
    color: #eee;
}

body.dark-mode .form-control {
    background-color: #1a1a2e;
    border-color: #667eea;
    color: #eee;
}

body.dark-mode .form-control:focus {
    background-color: #1a1a2e;
    color: #eee;
    border-color: #764ba2;
}

body.dark-mode .form-label {
    color: #eee;
}

body.dark-mode footer {
    background: linear-gradient(135deg, #2d3561 0%, #3d2d5a 100%);
    color: #eee;
}

body.dark-mode .footer-link {
    color: rgba(255, 255, 255, 0.8) !important;
}

body.dark-mode .card {
    background-color: #0f3460;
    color: #eee;
    border-color: #667eea;
}

body.dark-mode .card-body {
    color: #eee;
}

body.dark-mode .datetime-display {
    color: #aaa;
}

/* Media Queries específicas para iPad */
@media (min-width: 768px) and (max-width: 1024px) {
    /* iPad Portrait */
    .sidebar {
        width: 100%;
        max-width: 35%;
    }
    
    .main-content {
        width: 100%;
        max-width: 65%;
    }
    
    .login-card {
        max-width: 500px;
        padding: 40px;
    }
    
    .brand-title {
        font-size: 3rem;
    }
}

@media (min-width: 1024px) and (max-width: 1366px) {
    /* iPad Pro 11" y 12.9" */
    .sidebar {
        width: 100%;
        max-width: 30%;
    }
    
    .main-content {
        width: 100%;
        max-width: 70%;
    }
    
    .login-card {
        max-width: 650px;
    }
}

/* Asegurar que ningún elemento se salga del viewport */
img, video, iframe {
    max-width: 100%;
    height: auto;
}

.row {
    margin-left: 0;
    margin-right: 0;
}

.col, [class*="col-"] {
    padding-left: 0;
    padding-right: 0;
}

.navbar-custom .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
}

.navbar-custom .navbar-toggler-icon {
    filter: brightness(0) invert(1);
}

.modal-scroll {
    max-height: 70vh;
    overflow-y: auto;
}

.btn-inline-danger {
    display: inline-block;
    padding: 5px 10px;
    margin-left: 10px;
    background-color: #dc3545;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    cursor: pointer;
}

.btn-inline-danger:hover {
    color: white;
    text-decoration: none;
    background-color: #c82333;
}

/* Footer Styles */
footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 15px 20px;
    margin-top: auto;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.1);
    width: 100%;
}

footer .footer-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

footer .row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 80px;
    margin: 0;
}

footer .col-md-4 {
    flex: 1 1 320px;
    min-width: 280px;
    text-align: center;
    max-width: 420px;
}

footer h5 {
    font-weight: 700;
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

footer p {
    font-size: 0.95rem;
    margin-bottom: 8px;
    opacity: 0.95;
}

footer .list-unstyled {
    padding-left: 0;
    list-style: none;
}

footer .list-unstyled li {
    margin-bottom: 8px;
}

.footer-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.footer-link:hover {
    color: white;
    text-decoration: underline;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    justify-content: center;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    color: #ffd700;
}

footer hr {
    border-color: rgba(255, 255, 255, 0.2);
    margin: 20px 0 15px 0;
}

footer .text-center {
    font-size: 0.9rem;
    opacity: 0.9;
}

footer .footer-bottom-row {
    margin-top: auto;
    justify-content: center;
    align-items: center;
}

@media (max-width: 768px) {
    footer .row {
        flex-direction: column;
    }
    
    footer .col-md-4 {
        width: 100%;
    }
}
