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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    min-height: 100vh;
    color: #333;
}

/* Login Container */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo i {
    color: #2563eb;
    margin-bottom: 15px;
}

.logo h2 {
    color: #2563eb;
    font-size: 24px;
    margin-bottom: 5px;
}

.logo p {
    color: #666;
    font-size: 14px;
}

/* Input Groups */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.input-group input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.login-btn, .btn-primary, .getkey-btn, .shortener-btn {
    width: 100%;
    padding: 12px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.login-btn:hover, .btn-primary:hover, .getkey-btn:hover, .shortener-btn:hover {
    background: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

/* Alerts */
.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.alert.error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Dashboard Styles */
.dashboard-container {
    background: #f8fafc;
    min-height: 100vh;
}

.dashboard-header {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    color: #2563eb;
    margin-bottom: 5px;
}

.user-role {
    color: #666;
    font-size: 14px;
}

.logout-btn {
    background: #ef4444;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: #dc2626;
}

.dashboard-content {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    font-size: 24px;
}

.stat-icon.total { background: #dbeafe; color: #2563eb; }
.stat-icon.active { background: #d1fae5; color: #065f46; }
.stat-icon.used { background: #fef3c7; color: #d97706; }
.stat-icon.expired { background: #f3f4f6; color: #6b7280; }

.stat-info h3 {
    font-size: 28px;
    margin-bottom: 5px;
    color: #1f2937;
}

.stat-info p {
    color: #6b7280;
    font-size: 14px;
}

/* Sections */
.section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.section h2 {
    color: #2563eb;
    margin-bottom: 20px;
    font-size: 20px;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input {
    width: auto;
    margin-right: 10px;
}

/* Buttons Variants */
.btn-secondary {
    background: #6b7280;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-warning {
    background: #f59e0b;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s;
}

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

.btn-success {
    background: #10b981;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-success:hover {
    background: #059669;
}

/* Keys List */
.keys-list {
    max-height: 400px;
    overflow-y: auto;
}

.key-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f9fafb;
}

.key-value {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #1f2937;
}

.key-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.key-status.active { background: #d1fae5; color: #065f46; }
.key-status.used { background: #fef3c7; color: #d97706; }
.key-status.expired { background: #f3f4f6; color: #6b7280; }

.no-data {
    text-align: center;
    color: #6b7280;
    padding: 40px;
    font-style: italic;
}

/* Get Key Page Styles */
.getkey-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.getkey-box {
    background: white;
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.getkey-header i {
    color: #2563eb;
    margin-bottom: 20px;
}

.getkey-header h1 {
    color: #2563eb;
    font-size: 32px;
    margin-bottom: 10px;
}

.getkey-header p {
    color: #666;
    font-size: 18px;
    margin-bottom: 30px;
}

.features-list {
    margin: 30px 0;
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    color: #059669;
}

.feature-item i {
    margin-right: 10px;
}

.getkey-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    color: #666;
}

/* Key Display Page */
.key-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.key-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    max-width: 600px;
    width: 100%;
}

.key-header {
    text-align: center;
    margin-bottom: 30px;
}

.key-header.success i {
    color: #10b981;
}

.key-display {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.key-display input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    background: #f8fafc;
}

.copy-btn {
    background: #2563eb;
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.copy-btn:hover {
    background: #1e40af;
}

.key-info {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.info-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    color: #374151;
}

.info-item i {
    margin-right: 10px;
    color: #2563eb;
}

.key-instructions {
    background: #fff7ed;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.key-instructions h3 {
    color: #ea580c;
    margin-bottom: 15px;
}

.key-instructions ol {
    text-align: left;
    padding-left: 20px;
}

.key-instructions li {
    margin-bottom: 8px;
    color: #374151;
}

.key-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.key-actions .btn-primary, .key-actions .btn-secondary {
    flex: 1;
    min-width: 200px;
}

/* Shortener Page */
.shortener-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.shortener-box {
    background: white;
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.shortener-header i {
    color: #f59e0b;
    margin-bottom: 20px;
}

.shortener-header h2 {
    color: #1f2937;
    margin-bottom: 10px;
}

.shortener-header p {
    color: #666;
    margin-bottom: 30px;
}

.loading-animation {
    margin: 30px 0;
}

.loading-animation i {
    font-size: 48px;
    color: #2563eb;
    margin-bottom: 15px;
}

.shortener-info {
    margin: 30px 0;
}

/* Maintenance Page */
.maintenance-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

.maintenance-box {
    background: white;
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.maintenance-box i {
    color: #f59e0b;
    margin-bottom: 20px;
}

.maintenance-box h2 {
    color: #1f2937;
    margin-bottom: 15px;
}

.maintenance-box p {
    color: #666;
    margin-bottom: 30px;
    font-size: 18px;
}

/* Text Center */
.text-center {
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .login-box, .getkey-box, .key-box, .shortener-box, .maintenance-box {
        padding: 30px 20px;
    }
    
    .dashboard-content {
        padding: 20px 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .key-actions {
        flex-direction: column;
    }
    
    .key-display {
        flex-direction: column;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}