/**
 * Gym Fitness Logger Plugin Styles
 * Author: Vincent Rozenberg
 * Version: 1.0.0
 */

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, sans-serif;
}

/* Main Container */
.dipole-calculator-container {
    background-color: #ffffff;
    padding: 24px;
    border-radius: 0px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid #e5e5e5;
    max-width: 800px;
    margin: 0 auto;
}

/* Title Styling */
.dipole-calculator-title {
    color: #000000;
    margin-bottom: 24px;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.2px;
}

/* Input Groups */
.dipole-calculator-input-group {
    margin-bottom: 16px;
}

/* Labels */
.dipole-calculator-label {
    display: block;
    margin-bottom: 8px;
    color: #000000;
    font-weight: 400;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Input Fields */
.dipole-calculator-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 0px;
    font-size: 16px;
    background-color: #ffffff;
    transition: border-color 0.2s ease;
}

.dipole-calculator-input:focus {
    outline: none;
    border-color: #000000;
    box-shadow: none;
}

/* Select Dropdown Styling */
select.dipole-calculator-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
}

/* Textarea Styling */
textarea.dipole-calculator-input {
    resize: vertical;
    min-height: 120px;
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.5;
}

/* Results Container */
.dipole-calculator-results {
    margin-top: 16px;
    padding: 16px;
    background-color: #fafafa;
    border-radius: 0px;
    border: 1px solid #e5e5e5;
}

/* Result Items */
.dipole-calculator-result-item {
    margin-bottom: 12px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    color: #333333;
    padding: 8px 0;
    border-bottom: 1px solid #e5e5e5;
}

.dipole-calculator-result-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.dipole-calculator-result-item strong {
    color: #000000;
    font-weight: 500;
}

/* Button Styling */
.button {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #e5e5e5;
    background-color: #ffffff;
    color: #000000;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    border-radius: 0px;
}

.button:hover {
    background-color: #f5f5f5;
    border-color: #d4d4d4;
}

.button-primary {
    background-color: #000000;
    color: #ffffff;
    border-color: #000000;
}

.button-primary:hover {
    background-color: #333333;
    border-color: #333333;
    color: #ffffff;
}

.button-secondary {
    background-color: #f5f5f5;
    color: #000000;
    border-color: #e5e5e5;
}

.button-secondary:hover {
    background-color: #e5e5e5;
    border-color: #d4d4d4;
}

/* Delete Button Styling */
.delete-equipment,
.delete-activity {
    background-color: #fff8f8;
    color: #dc2626;
    border-color: #fecaca;
    font-size: 12px;
    padding: 4px 8px;
}

.delete-equipment:hover,
.delete-activity:hover {
    background-color: #fef2f2;
    border-color: #f87171;
    color: #dc2626;
}

/* Messages and Notifications */
.gym-fitness-message {
    padding: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 0px;
    font-size: 14px;
    margin-top: 16px;
}

.gym-fitness-message.success {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

.gym-fitness-message.error {
    background-color: #fff8f8;
    border-color: #fecaca;
    color: #dc2626;
}

/* Loading States */
.gym-fitness-loading {
    opacity: 0.6;
    pointer-events: none;
}

.gym-fitness-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #000000;
    border-radius: 50%;
    animation: gym-fitness-spin 1s linear infinite;
}

@keyframes gym-fitness-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form Styling */
#gym-fitness-form {
    position: relative;
}

#gym-fitness-form.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Admin Page Specific Styles */
.wrap .dipole-calculator-container {
    margin-bottom: 20px;
}

.wrap .dipole-calculator-container:last-child {
    margin-bottom: 0;
}

/* Code Block Styling */
code {
    background-color: #f5f5f5;
    padding: 4px 8px;
    border: 1px solid #e5e5e5;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    color: #333333;
    border-radius: 0px;
}

/* Activity Description in Admin */
.dipole-calculator-result-item small {
    color: #666666;
    font-size: 12px;
    line-height: 1.4;
    margin-top: 4px;
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dipole-calculator-container {
        padding: 16px;
        margin: 0 10px;
    }
    
    .dipole-calculator-title {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    .dipole-calculator-result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .delete-equipment,
    .delete-activity {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .dipole-calculator-input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 10px;
    }
    
    .button {
        width: 100%;
        text-align: center;
        padding: 10px 16px;
    }
    
    .dipole-calculator-result-item .button {
        width: auto;
        margin-top: 8px;
    }
}

/* WordPress Admin Specific Overrides */
.wp-admin .dipole-calculator-container {
    box-shadow: none;
    border: 1px solid #c3c4c7;
    background-color: #fff;
}

.wp-admin .button {
    text-shadow: none;
    box-shadow: none;
}

.wp-admin .button-primary {
    background: #000000;
    border-color: #000000;
    box-shadow: none;
    text-shadow: none;
}

.wp-admin .button-primary:hover {
    background: #333333;
    border-color: #333333;
}

/* Notice Styles for Admin */
.notice {
    margin: 5px 0 15px;
    padding: 12px;
    border-left: 4px solid;
    background-color: #fff;
}

.notice-success {
    border-left-color: #00a32a;
    background-color: #f0fdf4;
}

.notice-error {
    border-left-color: #d63638;
    background-color: #fff8f8;
}

/* Activity Log Specific Styling */
.activity-log-item {
    padding: 12px;
    border-bottom: 1px solid #e5e5e5;
}

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

.activity-equipment {
    font-weight: 500;
    color: #000000;
    margin-bottom: 4px;
}

.activity-description {
    color: #333333;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 4px;
}

.activity-date {
    color: #666666;
    font-size: 12px;
}

/* CSV Export Section */
.csv-export-info {
    background-color: #f8f9fa;
    padding: 16px;
    border: 1px solid #e5e5e5;
    margin-top: 16px;
}

.csv-export-info code {
    display: block;
    margin: 8px 0;
    padding: 8px;
    word-break: break-all;
}

/* Shortcode Usage Section */
.shortcode-usage {
    background-color: #f0f8ff;
    padding: 16px;
    border: 1px solid #b3d9ff;
    margin-top: 16px;
}

.shortcode-usage code {
    background-color: #e6f3ff;
    border-color: #b3d9ff;
}