/* Reset and Base Styles */
:root {
    --max-width: 1200px;
    --container-padding: clamp(0.75rem, 2vw, 2rem);
    --card-padding: clamp(1rem, 2.2vw, 3rem);
    --radius: 14px;
    --muted: #666;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --surface: #ffffff;
    --accent: #667eea;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Fluid base font */
html { font-size: clamp(14px, 1.4vw, 16px); }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: #222;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--container-padding);
}

header h1 {
    color: white;
    font-size: clamp(1.2rem, 2.4vw, 1.9rem);
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
}

/* Login Section */
.login-container, .pin-container, .employee-selection-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 72vh;
    padding: var(--container-padding);
}

.login-card, .selection-card, .pin-card {
    background: var(--surface);
    padding: var(--card-padding);
    border-radius: var(--radius);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
    text-align: center;
    width: 100%;
    max-width: 420px;
}

.selection-card {
    max-width: 920px;
}

/* PIN Section */
.pin-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 2rem;
}

.pin-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.pin-card h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.pin-card p {
    margin-bottom: 2rem;
    opacity: 0.9;
}

.pin-input-container {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
}

#pinInput {
    flex: 1;
    padding: 0.9rem;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 0.5rem;
    font-weight: 700;
}

#pinInput:focus {
    outline: 3px solid rgba(255, 255, 255, 0.3);
}

.error-message {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid rgba(255, 107, 107, 0.5);
    padding: 0.75rem;
    border-radius: 8px;
    color: #ffcccb;
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Employee Selection Section */
.employee-selection-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 2rem;
}

.employees-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    max-height: 50vh;
    overflow-y: auto;
    padding: 0.75rem;
    border: 1px solid #e6edf6;
    border-radius: 10px;
    background: #f8fafc;
}

.selection-card h2 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.5rem;
}

.selection-card p {
    margin-bottom: 2rem;
    color: #666;
}

.employee-button {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    text-align: left;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.employee-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.employee-button:active {
    transform: translateY(-1px);
}

.employee-handle {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.employee-description {
    font-size: 0.9rem;
    opacity: 0.9;
}

.founder-button {
    background: linear-gradient(135deg, #ff6b6b, #ffa500) !important;
    border: 2px solid #fff;
}

.founder-button .employee-handle::after {
    content: " 👑";
    font-size: 1rem;
}

/* Employee Dashboard */
.employee-dashboard {
    margin-bottom: 2rem;
}

.employee-card-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.employee-card-section h3 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.2rem;
}

.employee-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-card {
    background: linear-gradient(135deg, #4ade80, #22d3ee);
    padding: 1.5rem;
    border-radius: 12px;
    color: white;
    text-align: center;
    transition: transform 0.3s ease;
}

.action-card:hover {
    transform: translateY(-3px);
}

.action-card i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.action-card h4 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.action-card p {
    margin-bottom: 1rem;
    opacity: 0.9;
    font-size: 0.9rem;
}

.action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.status-select {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.notification-enabled {
    background: linear-gradient(135deg, #10b981, #059669) !important;
}

.notification-disabled {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
}

.login-card h2 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.5rem;
}

.login-card p {
    margin-bottom: 2rem;
    color: #666;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #4285f4;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.google-btn:hover {
    background: #3367d6;
    transform: translateY(-2px);
}

/* Dashboard */
.dashboard {
    padding: 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Founder Controls */
.founder-section {
    margin-bottom: 3rem;
}

.alert-card {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    padding: 2rem;
    border-radius: 15px;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.alert-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.alert-card p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.alert-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

#alertMessage {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 200px;
}

#alertType {
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: #333;
}

.alert-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-btn:hover {
    background: white;
    color: #ff6b6b;
}

/* Employees Section */
.employees-section, .notifications-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.employees-section h3, .notifications-section h3 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.2rem;
}

.employees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.employee-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 1.5rem;
    border-radius: 12px;
    color: white;
    transition: transform 0.3s ease;
}

.employee-card:hover {
    transform: translateY(-5px);
}

.employee-handle {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.employee-email {
    opacity: 0.9;
    font-size: 0.9rem;
}

.employee-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
}

/* Notifications List */
.notifications-list {
    max-height: 40vh;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border-left: 4px solid #667eea;
    background: #f8fafc;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.notification-type {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.notification-time {
    color: #666;
    font-size: 0.8rem;
}

.notification-message {
    color: #333;
}

/* Buttons */
.btn-primary {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #5a67d8;
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 1rem;
    color: #333;
}

.modal-content p {
    margin-bottom: 2rem;
    color: #666;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 900px) {
    .header-content { padding: 0 1rem; }
    .container { padding: 0 1rem; }
}

@media (max-width: 768px) {
    .header-content { padding: 0 0.75rem; }
    
    .alert-controls { flex-direction: column; align-items: stretch; }
    #alertMessage, #alertType, .alert-btn { width: 100%; }
    .employees-grid { grid-template-columns: 1fr; }
    .employee-button { padding: 0.9rem; border-radius: 10px; }
    .login-card, .pin-card, .selection-card { padding: 1.25rem; border-radius: 12px; }
}

@media (max-width: 480px) {
    html { font-size: 14px; }
    header h1 { font-size: 1.1rem; }
    .header-content { padding: 0 0.5rem; }
    .login-card, .pin-card, .selection-card { max-width: 95%; }
    .employees-buttons { grid-template-columns: 1fr; }
    .employees-buttons { padding: 0.5rem; }
    #pinInput { letter-spacing: 0.3rem; }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}