/**
 * Main styles for Tennis Team Manager
 * 
 * Path: /wp-content/plugins/tennis-team-manager/assets/css/ttm-styles.css
 */

/* Base Styles */
:root {
    --ttm-primary: #2c3e50;
    --ttm-secondary: #3498db;
    --ttm-accent: #e74c3c;
    --ttm-light: #ecf0f1;
    --ttm-dark: #2c3e50;
    --ttm-success: #2ecc71;
    --ttm-warning: #f39c12;
    --ttm-danger: #e74c3c;
    --ttm-gray: #95a5a6;
    --ttm-light-gray: #f5f5f5;
    --ttm-border: #ddd;
    
    --ttm-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --ttm-shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
    
    --ttm-radius: 8px;
    --ttm-radius-sm: 4px;
    
    --ttm-spacing: 20px;
    --ttm-spacing-sm: 10px;
    --ttm-spacing-lg: 30px;
}

/* Container */
.ttm-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--ttm-dark);
    line-height: 1.6;
}

/* Typography */
.ttm-container h1, .ttm-container h2, .ttm-container h3, .ttm-container h4 {
    color: var(--ttm-primary);
    margin-top: 0;
    font-weight: 600;
}

.ttm-container h2 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--ttm-secondary);
    font-size: 24px;
}

.ttm-container h3 {
    margin-bottom: 15px;
    font-size: 20px;
}

.ttm-container h4 {
    margin-bottom: 10px;
    font-size: 18px;
}

.ttm-container p {
    margin-bottom: 15px;
}

/* Cards */
.ttm-card {
    background-color: white;
    border-radius: var(--ttm-radius);
    box-shadow: var(--ttm-shadow);
    padding: var(--ttm-spacing);
    margin-bottom: var(--ttm-spacing);
}

/* Tabs */
.ttm-tabs {
    display: flex;
    gap: 2px;
    background-color: #ddd;
    border-radius: var(--ttm-radius) var(--ttm-radius) 0 0;
    overflow: hidden;
    margin-bottom: 0;
}

.ttm-tab {
    padding: 12px 20px;
    background-color: #ddd;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.ttm-tab.active {
    background-color: white;
}

.ttm-tab:hover:not(.active) {
    background-color: #ccc;
}

.ttm-tab-content {
    display: none;
    background-color: white;
    padding: var(--ttm-spacing);
    border-radius: 0 0 var(--ttm-radius) var(--ttm-radius);
    box-shadow: var(--ttm-shadow);
    margin-bottom: var(--ttm-spacing);
}

.ttm-tab-content.active {
    display: block;
}

/* Buttons */
.ttm-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--ttm-secondary);
    color: white;
    border: none;
    border-radius: var(--ttm-radius-sm);
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    font-weight: 500;
    margin-right: 10px;
    margin-bottom: 10px;
    font-size: 14px;
}

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

.ttm-btn-success {
    background-color: var(--ttm-success);
}

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

.ttm-btn-warning {
    background-color: var(--ttm-warning);
}

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

.ttm-btn-danger {
    background-color: var(--ttm-danger);
}

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

.ttm-btn:disabled {
    background-color: var(--ttm-gray);
    cursor: not-allowed;
}

/* Forms */
.ttm-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ttm-border);
    border-radius: var(--ttm-radius-sm);
    margin-bottom: 15px;
    font-size: 14px;
}

.ttm-input:focus {
    outline: none;
    border-color: var(--ttm-secondary);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.ttm-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.ttm-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ttm-border);
    border-radius: var(--ttm-radius-sm);
    margin-bottom: 15px;
    font-size: 14px;
    background-color: white;
}

.ttm-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ttm-border);
    border-radius: var(--ttm-radius-sm);
    margin-bottom: 15px;
    font-size: 14px;
    min-height: 100px;
    resize: vertical;
}

/* Tables */
.ttm-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--ttm-spacing);
}

.ttm-table, .ttm-table th, .ttm-table td {
    border: 1px solid var(--ttm-border);
}

.ttm-table th, .ttm-table td {
    padding: 12px;
    text-align: left;
}

.ttm-table th {
    background-color: var(--ttm-primary);
    color: white;
    font-weight: 500;
}

.ttm-table tr:nth-child(even) {
    background-color: var(--ttm-light-gray);
}

.ttm-table tr:hover {
    background-color: #e8f6ff;
}

/* Status Indicators */
.ttm-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--ttm-radius-sm);
    font-size: 12px;
    font-weight: 500;
}

.ttm-status-success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.ttm-status-warning {
    background-color: #fff8e1;
    color: #f57f17;
}

.ttm-status-danger {
    background-color: #ffebee;
    color: #c62828;
}

.ttm-status-info {
    background-color: #e3f2fd;
    color: #1565c0;
}

/* Notifications */
.ttm-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--ttm-success);
    color: white;
    padding: 15px 20px;
    border-radius: var(--ttm-radius-sm);
    box-shadow: var(--ttm-shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 9999;
}

.ttm-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.ttm-notification.error {
    background-color: var(--ttm-danger);
}

/* Import Page Specific Styles */
.ttm-import-container {
    max-width: 900px;
}

.ttm-steps {
    display: flex;
    margin-bottom: 30px;
}

.ttm-step {
    flex: 1;
    text-align: center;
    padding: 15px;
    position: relative;
}

.ttm-step:not(:last-child):after {
    content: '';
    position: absolute;
    top: 50%;
    right: -10px;
    width: 20px;
    height: 2px;
    background-color: #ddd;
}

.ttm-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--ttm-secondary);
    color: white;
    font-weight: bold;
    margin-bottom: 8px;
}

.ttm-step-title {
    font-weight: 500;
    margin-bottom: 5px;
}

.ttm-step-description {
    color: #777;
    font-size: 0.9em;
}

.ttm-radio-group {
    display: flex;
    margin-bottom: 20px;
    gap: 20px;
}

.ttm-radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.ttm-radio-option input {
    margin-right: 8px;
}

.ttm-upload-area {
    border: 2px dashed #ccc;
    padding: 30px;
    text-align: center;
    border-radius: var(--ttm-radius);
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.ttm-upload-area:hover {
    border-color: var(--ttm-secondary);
    background-color: #f7f7f7;
}

.ttm-sample-csv {
    font-family: monospace;
    background-color: #f8f8f8;
    padding: 15px;
    border-radius: var(--ttm-radius);
    margin-bottom: 10px;
    white-space: pre-wrap;
    user-select: all;
    cursor: copy;
    border: 1px solid #ddd;
}

.ttm-json-display {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--ttm-border);
    border-radius: var(--ttm-radius);
    min-height: 200px;
    font-family: monospace;
    background-color: #f8f8f8;
    white-space: pre-wrap;
    overflow-y: auto;
    margin-bottom: 15px;
}

.ttm-validation-message {
    color: var(--ttm-danger);
    margin-top: 10px;
    margin-bottom: 10px;
    font-size: 14px;
}

.ttm-validation-message.success {
    color: var(--ttm-success);
}

.ttm-action-buttons {
    display: flex;
    gap: 10px;
}

/* Main App Specific Styles */
.ttm-menu {
    display: flex;
    gap: 2px;
    background-color: var(--ttm-primary);
    border-radius: var(--ttm-radius) var(--ttm-radius) 0 0;
    overflow: hidden;
    margin-bottom: 0;
}

.ttm-menu-item {
    padding: 12px 20px;
    background-color: var(--ttm-primary);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.ttm-menu-item.active {
    background-color: var(--ttm-secondary);
}

.ttm-menu-item:hover:not(.active) {
    background-color: #34495e;
}

.ttm-page {
    display: none;
    background-color: white;
    padding: var(--ttm-spacing);
    border-radius: 0 0 var(--ttm-radius) var(--ttm-radius);
    box-shadow: var(--ttm-shadow);
}

.ttm-page.active {
    display: block;
}

.ttm-dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.ttm-widget {
    background-color: white;
    border-radius: var(--ttm-radius);
    box-shadow: var(--ttm-shadow);
    padding: var(--ttm-spacing);
}

.ttm-widget-title {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--ttm-border);
    font-size: 18px;
    font-weight: 500;
}

/* Weather Styles */
.ttm-weather-forecast {
    display: flex;
    flex-direction: column;
}

.ttm-weather-summary {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ttm-temp {
    font-weight: bold;
    font-size: 16px;
}

.ttm-condition {
    font-size: 14px;
}

.ttm-weather-updated {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.ttm-btn-weather {
    background: none;
    border: none;
    color: var(--ttm-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s;
    font-size: 14px;
}

.ttm-btn-weather:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.ttm-weather-status {
    font-size: 12px;
    margin-top: 5px;
}

.ttm-weather-status.loading {
    color: var(--ttm-secondary);
}

.ttm-weather-status.success {
    color: var(--ttm-success);
}

.ttm-weather-status.error {
    color: var(--ttm-danger);
}

/* Weather Modal */
.ttm-weather-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.ttm-weather-modal-content {
    background-color: white;
    border-radius: var(--ttm-radius);
    box-shadow: var(--ttm-shadow-lg);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.ttm-weather-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--ttm-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ttm-weather-modal-header h3 {
    margin: 0;
}

.ttm-weather-modal-close {
    font-size: 24px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.ttm-weather-modal-close:hover {
    color: var(--ttm-danger);
}

.ttm-weather-modal-body {
    padding: 20px;
}

.ttm-weather-timeline {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 15px;
    padding: 20px 0;
    margin: 20px 0;
}

.ttm-weather-timeline-item {
    min-width: 120px;
    background-color: #f8f8f8;
    border-radius: var(--ttm-radius);
    padding: 15px;
    text-align: center;
    border: 1px solid var(--ttm-border);
}

.ttm-weather-timeline-item.match-time {
    background-color: #e8f4fd;
    border: 2px solid var(--ttm-secondary);
    position: relative;
}

.ttm-weather-timeline-item.match-time:before {
    content: "Match Time";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--ttm-secondary);
    color: white;
    padding: 2px 8px;
    border-radius: var(--ttm-radius-sm);
    font-size: 12px;
    white-space: nowrap;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .ttm-steps {
        flex-direction: column;
        gap: 15px;
    }
    
    .ttm-step:not(:last-child):after {
        display: none;
    }
    
    .ttm-radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .ttm-action-buttons {
        flex-direction: column;
    }
}
