/* StandupDrafter Styles - Mobile-First Responsive Design */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh;
}

/* Header Styles */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Main Container */
main {
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

/* Section Spacing */
.section {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.section h2 {
    font-size: 1.25rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Input Section */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-section label {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: block;
}

/* Textarea Styling */
textarea {
    width: 100%;
    min-height: 150px;
    padding: 0.75rem;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    border: 2px solid #ddd;
    border-radius: 6px;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

textarea::placeholder {
    color: #999;
    font-style: italic;
}

/* Button Styles */
button {
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

button:active {
    transform: translateY(1px);
}

/* Primary Button (Generate Update) */
.btn-primary {
    background-color: #3498db;
    color: white;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

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

.btn-primary:active {
    background-color: #21618c;
}

/* Secondary Button (Copy) */
.btn-secondary {
    background-color: #95a5a6;
    color: white;
    box-shadow: 0 2px 4px rgba(149, 165, 166, 0.3);
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-secondary:active {
    background-color: #6c7a7b;
}

/* Disabled Button States */
button:disabled {
    background-color: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

button:disabled:hover {
    background-color: #e0e0e0;
}

button:disabled:active {
    transform: none;
}

/* Output Section */
.output-section {
    display: none;
}

.output-section.visible {
    display: block;
}

.output-area {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    min-height: 100px;
    max-height: 500px;
    overflow-y: auto;
}

.output-area:empty::before {
    content: "Your generated update will appear here...";
    color: #999;
    font-style: italic;
}

/* Error Message Styling */
.error-message {
    background-color: #e74c3c;
    color: white;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    display: none;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
}

.error-message.visible {
    display: block;
}

.error-message::before {
    content: "⚠ ";
    font-weight: bold;
}

/* Loading Indicator */
.loading-indicator {
    display: none;
    text-align: center;
    padding: 2rem;
}

.loading-indicator.visible {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 1rem;
    color: #666;
    font-size: 14px;
}

/* History Section */
.history-section {
    max-height: 400px;
    overflow-y: auto;
}

.history-list {
    list-style: none;
}

.history-item {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:hover {
    background-color: #f8f9fa;
}

.history-timestamp {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.history-preview {
    display: block;
    font-size: 0.9rem;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-empty {
    text-align: center;
    color: #999;
    padding: 2rem;
    font-style: italic;
}

.history-error {
    text-align: center;
    color: #e74c3c;
    padding: 1.5rem;
    font-style: italic;
}

/* Button Container for Multiple Buttons */
.button-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Confirmation Message */
.confirmation-message {
    background-color: #27ae60;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-top: 0.5rem;
    display: none;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.3);
}

.confirmation-message.visible {
    display: block;
}

/* Responsive Media Queries */

/* Mobile devices (320px - 480px) */
@media (min-width: 320px) {
    body {
        font-size: 14px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .section {
        padding: 1rem;
    }
    
    button {
        width: 100%;
        padding: 0.875rem;
    }
    
    .button-container {
        flex-direction: column;
    }
}

/* Small tablets (481px - 768px) */
@media (min-width: 481px) {
    body {
        font-size: 15px;
    }
    
    header h1 {
        font-size: 1.75rem;
    }
    
    header {
        padding: 1.75rem 1rem;
    }
    
    main {
        margin: 2rem auto;
    }
    
    .section {
        padding: 1.5rem;
    }
    
    button {
        width: auto;
        min-width: 150px;
    }
    
    .button-container {
        flex-direction: row;
    }
}

/* Tablets and small desktops (769px - 1024px) */
@media (min-width: 769px) {
    body {
        font-size: 16px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    header {
        padding: 2rem;
    }
    
    main {
        margin: 2.5rem auto;
        padding: 0 2rem;
    }
    
    .section {
        padding: 2rem;
        margin-bottom: 2rem;
    }
    
    .section h2 {
        font-size: 1.5rem;
    }
    
    textarea {
        min-height: 180px;
    }
}

/* Large desktops (1025px - 1440px) */
@media (min-width: 1025px) {
    header h1 {
        font-size: 2.25rem;
    }
    
    main {
        margin: 3rem auto;
    }
    
    textarea {
        min-height: 200px;
    }
    
    .history-section {
        max-height: 500px;
    }
}

/* Extra large screens (1441px - 1920px) */
@media (min-width: 1441px) {
    header h1 {
        font-size: 2.5rem;
    }
    
    .section {
        padding: 2.5rem;
    }
    
    textarea {
        min-height: 220px;
        font-size: 15px;
    }
    
    button {
        font-size: 15px;
        padding: 0.875rem 1.75rem;
    }
}

/* Copy button success state */
.btn-copy-success {
    background-color: #27ae60 !important;
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.3) !important;
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    body {
        background-color: white;
    }
    
    header {
        background-color: transparent;
        color: black;
        box-shadow: none;
        border-bottom: 2px solid black;
    }
    
    .section {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    button,
    .history-section,
    .loading-indicator,
    .error-message {
        display: none !important;
    }
}
