/**
 * N3XT Communication - Mobile-First Responsive CSS
 * 
 * This stylesheet provides a responsive, mobile-first design for all
 * N3XT Communication back office modules.
 */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    min-height: 100vh;
}

/* Container and Layout */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 15px;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    border-bottom: 3px solid #3498db;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 5px;
}

.header p {
    text-align: center;
    opacity: 0.9;
    font-size: 16px;
}
}

.main-content {
    padding: 30px 0;
}

/* Navigation */
.nav {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    padding: 15px 0;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 15px;
}

.nav-item {
    width: 100%;
}

.nav-link {
    display: block;
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 1px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-link.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

/* Cards and Panels */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

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

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px 25px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.card-body {
    padding: 25px;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background: #fff;
}

.form-control:disabled {
    background: #f8f9fa;
    color: #6c757d;
}

.form-control.error {
    border-color: #e74c3c;
}

.form-control.error:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 20px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 120px;
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: #3498db;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
}

.btn-success:hover {
    background: #219a52;
}

.btn-warning {
    background: #f39c12;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-secondary {
    background: #95a5a6;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-block {
    width: 100%;
    margin-bottom: 10px;
}

/* Alerts */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    position: relative;
}

.alert-success {
    background: #d5f5d5;
    color: #27ae60;
    border: 1px solid #27ae60;
}

.alert-error,
.alert-danger {
    background: #f8d7da;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

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

.alert-info {
    background: #d1ecf1;
    color: #3498db;
    border: 1px solid #3498db;
}

/* Progress bars */
.progress {
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    height: 20px;
    margin-bottom: 15px;
}

.progress-bar {
    background: #3498db;
    height: 100%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 500;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table th,
.table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

/* File upload */
.file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: block;
    padding: 12px;
    background: #ecf0f1;
    border: 2px dashed #bdc3c7;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload:hover .file-upload-label {
    background: #d5dbdb;
    border-color: #95a5a6;
}

/* Captcha */
.captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.captcha-image {
    border: 1px solid #bdc3c7;
    border-radius: 4px;
}

.captcha-refresh {
    background: none;
    border: 1px solid #3498db;
    color: #3498db;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

/* Loading spinner */
.spinner {
    border: 3px solid #ecf0f1;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 20px; }
.p-1 { padding: 5px; }
.p-2 { padding: 10px; }
.p-3 { padding: 20px; }

/* Responsive Design - Tablet */
@media (min-width: 768px) {
    .container {
        max-width: 750px;
        padding: 20px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .nav-menu {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
    }
    
    .nav-item {
        width: auto;
    }
    
    .card-body {
        padding: 30px;
    }
    
    .form-group {
        margin-bottom: 25px;
    }
    
    .btn {
        padding: 14px 25px;
        font-size: 16px;
    }
    
    .captcha-container {
        justify-content: flex-start;
    }
}

/* Responsive Design - Desktop */
@media (min-width: 1024px) {
    .container {
        max-width: 1200px;
        padding: 20px;
    }
    
    .header h1 {
        font-size: 32px;
    }
    
    .header p {
        font-size: 18px;
    }
    
    .main-content {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 40px;
        align-items: start;
        padding: 40px 0;
    }
    
    .nav {
        background: white;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        padding: 25px;
        position: sticky;
        top: 20px;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 8px;
        padding: 0;
    }
    
    .nav-link {
        padding: 12px 16px;
        border-radius: 8px;
        color: #2c3e50;
        font-weight: 500;
    }
    
    .nav-link:hover {
        background: rgba(52, 152, 219, 0.1);
        transform: none;
        color: #3498db;
    }
    
    .nav-link.active {
        background: linear-gradient(135deg, #3498db, #2980b9);
        color: white;
    }
    
    .card-body {
        padding: 30px;
    }
    
    .btn {
        padding: 14px 24px;
        font-size: 16px;
    }
}
    
    .nav-link {
        color: #2c3e50;
        border-radius: 6px;
    }
    
    .nav-link:hover,
    .nav-link.active {
        background: #3498db;
        color: white;
    }
    
    .content-area {
        min-height: 500px;
    }
    
    .btn-group {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .btn-group .btn {
        flex: 1;
        min-width: 150px;
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    .main-content {
        grid-template-columns: 300px 1fr;
        gap: 40px;
    }
}