/* ========================================
   Sales Analysis System - Main Stylesheet
   ======================================== */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    background: linear-gradient(135deg, #7f1d1d 0%, #dc2626 50%, #ef4444 100%);
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Input Section Styles */
.input-section {
    background: white;
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.logo {
    max-width: 200px;
    margin: 0 auto 20px;
    display: block;
}

h1 {
    color: #2d3748;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-align: center;
}

.subtitle {
    color: #718096;
    font-size: 1.1em;
    margin-bottom: 30px;
    text-align: center;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1em;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #dc2626;
}

.period-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

/* Branches Container */
.branches-container {
    background: #f7fafc;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.branches-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.branches-header h2 {
    color: #2d3748;
    font-size: 1.5em;
}

.add-branch-btn {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    transition: transform 0.2s ease;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.add-branch-btn:hover {
    transform: translateY(-2px);
}

/* Branch Item Styles */
.branch-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: relative;
}

.branch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.branch-number {
    background: #dc2626;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1em;
}

.remove-branch-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 0.9em;
    transition: background 0.3s ease;
}

.remove-branch-btn:hover {
    background: #dc2626;
}

.branch-fields {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 15px;
}

.branch-fields input {
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95em;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
}

.branch-fields input:focus {
    outline: none;
    border-color: #dc2626;
}

.field-label {
    font-size: 0.85em;
    color: #718096;
    margin-bottom: 5px;
}

/* Submit Button */
.submit-btn {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    border: none;
    padding: 15px 50px;
    border-radius: 10px;
    font-size: 1.2em;
    cursor: pointer;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    display: block;
    margin: 30px auto 0;
    transition: transform 0.2s ease;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
}

/* Results Section */
.results {
    display: none;
}

.header {
    background: white;
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    text-align: center;
}

.header h2 {
    color: #2d3748;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    color: #718096;
    font-size: 1.2em;
}

/* 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: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-label {
    color: #718096;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.stat-value {
    color: #2d3748;
    font-size: 2em;
    font-weight: bold;
}

.stat-change {
    margin-top: 8px;
    font-size: 0.9em;
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
}

.positive {
    background: #c6f6d5;
    color: #22543d;
}

.negative {
    background: #fed7d7;
    color: #742a2a;
}

/* Chart Container */
.chart-container {
    background: white;
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.chart-title {
    color: #2d3748;
    font-size: 1.5em;
    margin-bottom: 20px;
    text-align: center;
}

canvas {
    max-height: 400px;
}

/* Branch Cards */
.branch-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.branch-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.branch-name {
    color: #2d3748;
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.branch-detail {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #4a5568;
}

.branch-detail strong {
    color: #2d3748;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.download-pdf-btn {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    margin-top: 20px;
    margin-right: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.download-pdf-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.reset-btn {
    background: #1f2937;
    color: white;
    border: 2px solid #dc2626;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background: #dc2626;
    border-color: #dc2626;
}

/* Section Title */
.section-title {
    color: white;
    text-align: center;
    margin: 30px 0;
    font-size: 1.8em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .period-inputs {
        grid-template-columns: 1fr;
    }
    
    .branch-fields {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .header h2 {
        font-size: 2em;
    }
    
    .input-section {
        padding: 20px;
    }
}
