* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* Login Styles */
.login-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-width: 400px;
    margin: 100px auto;
    text-align: center;
}

.login-card h1 {
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.login-card p {
    color: #666;
    margin-bottom: 30px;
}

.admin-link {
    text-align: right;
    margin-bottom: 20px;
}

.admin-link a {
    background: #007cba;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Small Button Styles */
.btn-small {
    padding: 4px 8px;
    font-size: 0.9em;
}

/* Dashboard Styles */
.header {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    -webkit-box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    flex-wrap: wrap;
    -ms-flex-wrap: wrap;
}

.header h1 {
    color: #333;
    font-weight: 600;
    margin-bottom: 10px;
}

.header-actions {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 10px;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-card h3 {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.stat-number {
    font-size: 32px;
    font-weight: 600;
    color: #667eea;
}

/* Chart Container */
.chart-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    /* fix: set max height for chart canvas */
}

.chart-container canvas {
    height: 350px !important;
    max-height: 350px !important;
    width: 100% !important;
    display: block;
}

.chart-container h2 {
    margin-bottom: 20px;
    color: #333;
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 20px;
    background: white;
    border-radius: 12px;
    padding: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Dates Grid */
.dates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.date-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.date-card:hover {
    transform: translateY(-5px);
}

.date-card h3 {
    color: #333;
    margin-bottom: 10px;
}

.date-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.rating {
    display: flex;
    gap: 2px;
}

.star {
    color: #ffc107;
}

.date-actions {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 8px;
    margin-top: 15px;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

.date-actions .btn {
    padding: 6px 12px;
    font-size: 13px;
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-width: 80px;
    text-align: center;
    margin-bottom: 5px;
}

/* Collapsible Menu Styles */
.collapsible-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    overflow: visible; /* Allow content to overflow */
    margin-top: 10px;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.collapsible-header h3 {
    margin: 0;
    color: #333;
}

.collapsible-toggle {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.collapsible-toggle:hover {
    background-color: #f0f0f0;
}

.collapsible-content {
    display: none;
    animation: slideDown 0.3s ease-out;
    position: relative;
    z-index: 1;
    margin-top: 10px; /* Add some space from header */
}

.collapsible-content.active {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.man-dates-group {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    position: relative;
    z-index: 1;
}

.man-dates-group h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.man-dates-list {
    display: grid;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.date-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    position: relative;
    z-index: 1;
}

.date-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.date-item-date {
    font-weight: 500;
    color: #333;
}

.date-item-notes {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

.login-form {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 10px;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 30px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Error Messages */
.error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

/* Alert Messages */
.alert {
    margin: 15px 0;
    padding: 10px 15px;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Admin Styles */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.admin-nav a {
    margin-left: 15px;
    padding: 8px 15px;
    background: #333;
    color: white;
    text-decoration: none;
    border-radius: 5px;
}

.profile-admin-card {
    display: flex;
    align-items: center;
    padding: 20px;
    margin-bottom: 20px;
    background: #f9f9f9;
    border-radius: 10px;
}

.profile-admin-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-right: 20px;
}

.profile-info {
    flex: 1;
}

.profile-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.status-active { color: #28a745; }
.status-inactive { color: #6c757d; }
.status-pending { color: #ffc107; }

/* Public Content Styles */
.public-content {
    margin-bottom: 30px;
    position: relative;
}

.public-content h2 {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    color: #333;
    position: relative;
    z-index: 1;
}

/* Admin Content Styles */
.admin-content {
    margin-bottom: 30px;
}

.admin-content h2 {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    color: #333;
}

/* Simple Rating Form Styles */
.simple-rating-form {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.simple-rating-form select,
.simple-rating-form input[type="text"] {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.simple-rating-form input[type="text"] {
    min-width: 150px;
}

/* Quick Rating Form Styling */
.quick-rating-form {
    width: 100%;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.rating-form-row {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 5px;
}

.rating-label {
    font-weight: 500;
    color: #555;
    margin-right: 4px;
}

.rating-select {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f8f9fa;
    -webkit-box-flex: 0;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    min-width: 80px;
}

.rating-comment {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-width: 120px;
}

.btn-rating {
    margin-left: auto;
}

/* Improved Media Queries */
@media (max-width: 992px) {
    .header {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .stat-card h3 {
        font-size: 13px;
    }
    
    .stat-number {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        gap: 15px;
        text-align: center;
        -webkit-box-align: stretch;
        -ms-flex-align: stretch;
        align-items: stretch;
    }
    
    .header-actions {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        width: 100%;
    }
    
    .header-actions .btn,
    .header-actions a {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dates-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
    }
    
    .modal-content {
        margin: 20px auto;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .date-actions {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        gap: 5px;
    }
    
    .date-actions .btn {
        -webkit-box-flex: 0;
        -ms-flex: none;
        flex: none;
        min-width: auto;
        width: 100%;
    }
    
    .man-dates-list {
        grid-template-columns: 1fr;
    }
    
    .rating-form-row {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        -webkit-box-align: stretch;
        -ms-flex-align: stretch;
        align-items: stretch;
        gap: 10px;
    }
    
    .rating-select, .rating-comment, .btn-rating {
        width: 100%;
    }
    
    .btn-rating {
        margin-left: 0;
    }
    
    .chart-controls > div {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        width: 100%;
    }
    
    .chart-controls label,
    .chart-controls select,
    .chart-controls input {
        width: 100%;
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    .login-card {
        margin: 50px auto;
        padding: 20px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
    }
    
    .chart-container h2 {
        font-size: 18px;
    }
    
    .date-card h3 {
        font-size: 16px;
    }
    
    .date-meta {
        font-size: 12px;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    }
    
    .modal-content {
        padding: 15px;
    }
}
