/* DroneFlightLog - Main Stylesheet */

:root {
    --primary-color: #1e40af;
    --primary-dark: #1e293b;
    --primary-light: #3b82f6;
    --accent-color: #3b4258;
    --accent-dark: #2a2f3f;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --bg-gradient: linear-gradient(135deg, #1e40af 0%, #1e3a8a 50%, #0f172a 100%);
    --bg-gradient-light: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    --accent-gradient: linear-gradient(135deg, #3b4258 0%, #2a2f3f 100%);
    --border-color: #e5e7eb;
    --success-color: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: relative;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: transform 0.2s;
}

.logo:hover {
    transform: translateY(-2px);
}

.logo svg {
    width: 32px;
    height: 32px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

nav li {
    position: relative;
}

nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    display: block;
    position: relative;
}

nav a:not(.btn):hover {
    color: var(--primary-color);
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

nav a.active {
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
    font-weight: 600;
}

nav a.active:not(.btn):hover {
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* Hero Section */
.hero {
    background: var(--bg-gradient);
    color: white;
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 500px;
}

#heroCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.6;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: box-shadow 0.3s ease, filter 0.3s ease, background 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--bg-gradient-light);
    color: white;
    box-shadow: 0 4px 6px rgba(30, 64, 175, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 12px rgba(30, 64, 175, 0.4);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

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

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

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    color: var(--text-dark);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2), 0 0 0 3px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

input:hover,
select:hover,
textarea:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15), 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* Page Header (Sticky) */
.page-header {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 50%, #0f172a 100%);
    color: white;
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-header h1 {
    color: white;
    margin-bottom: 0.25rem;
}

.page-header p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 12px 24px rgba(30, 64, 175, 0.15);
    border-color: var(--primary-light);
}

/* Card with gradient headers - Only apply to direct child h3 that is first element */
.card > h3:first-child {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 1.5rem;
    margin: 0;
    border-radius: 0.5rem 0.5rem 0 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card:has(> h3:first-child) {
    padding: 0;
    overflow: hidden;
}

.card-body {
    padding: 1.5rem;
}

/* Feature Cards - Special styling for landing page */
.feature-card {
    background: linear-gradient(135deg, rgba(255,255,255,1) 0%, rgba(249,250,251,1) 100%);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    margin-bottom: 1.5rem;
    border: 2px solid transparent;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-gradient-light);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.feature-card > * {
    position: relative;
    z-index: 1;
}

.feature-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px rgba(30, 64, 175, 0.2);
    border-color: var(--accent-color);
}

.feature-card:hover::before {
    opacity: 0.05;
}

.feature-card:hover .feature-icon {
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 4px 8px rgba(251, 191, 36, 0.4));
}

.feature-card:hover h3 {
    color: var(--primary-color);
}

.feature-card:nth-child(1):hover {
    border-color: #3b82f6;
}

.feature-card:nth-child(2):hover {
    border-color: #fbbf24;
}

.feature-card:nth-child(3):hover {
    border-color: #10b981;
}

.feature-card:nth-child(4):hover {
    border-color: #8b5cf6;
}

.feature-card:nth-child(5):hover {
    border-color: #ec4899;
}

.feature-card:nth-child(6):hover {
    border-color: #f59e0b;
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0;
}

/* Grid */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Flight List */
.flight-item {
    background: var(--bg-white);
    border-radius: 0.5rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.flight-item:hover {
    box-shadow: 0 12px 24px rgba(30, 64, 175, 0.15);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.flight-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.flight-date {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
}

.flight-time {
    color: var(--text-light);
}

.flight-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--text-light);
}

.flight-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Recent Flight Card (used in dashboard and flights.php) */
.recent-flight-card {
    background: var(--bg-white);
    border-radius: 0.75rem;
    padding: 1.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.recent-flight-card:hover {
    box-shadow: 0 12px 24px rgba(30, 64, 175, 0.15);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

/* Weather Effect Animations */
@keyframes cloudDrift {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(120vw);
    }
}

@keyframes sunPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

@keyframes rainFall {
    0% {
        transform: translateY(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        transform: translateY(250px);
        opacity: 0;
    }
}

@keyframes windBlow {
    0% {
        transform: translateX(0);
        opacity: 0;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translateX(100vw);
        opacity: 0;
    }
}

@keyframes shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    border: 2px solid;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, currentColor 0%, transparent 100%);
}

.alert-success {
    background: linear-gradient(135deg, rgba(209, 250, 229, 0.95) 0%, rgba(167, 243, 208, 0.98) 100%);
    border-color: rgba(16, 185, 129, 0.3);
    color: #065f46;
}

.alert-danger,
.alert-error {
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.95) 0%, rgba(252, 165, 165, 0.98) 100%);
    border-color: rgba(239, 68, 68, 0.3);
    color: #991b1b;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(254, 243, 199, 0.95) 0%, rgba(253, 230, 138, 0.98) 100%);
    border-color: rgba(245, 158, 11, 0.3);
    color: #92400e;
}

.alert-info {
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.95) 0%, rgba(191, 219, 254, 0.98) 100%);
    border-color: rgba(59, 130, 246, 0.3);
    color: #1e40af;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-light); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden { display: none; }

/* SVG Icons */
.icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

.icon-sm {
    width: 16px;
    height: 16px;
}

.icon-md {
    width: 24px;
    height: 24px;
}

.icon-lg {
    width: 32px;
    height: 32px;
}

.icon-primary {
    fill: var(--primary-color);
}

.icon-accent {
    fill: var(--accent-color);
}

.icon-white {
    fill: white;
}

/* Feature Icons */
.feature-icon {
    width: 32px;
    height: 32px;
    fill: white;
    position: relative;
    z-index: 2;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Icon animations on card hover - each card gets unique animation */
#features .grid > div:nth-child(1):hover .feature-icon {
    animation: zap 0.6s ease-in-out;
}

#features .grid > div:nth-child(2):hover .feature-icon {
    animation: spin 0.8s ease-in-out;
}

#features .grid > div:nth-child(3):hover .feature-icon {
    animation: bounce 0.6s ease-in-out;
}

#features .grid > div:nth-child(4):hover .feature-icon {
    animation: fly 0.8s ease-in-out;
}

#features .grid > div:nth-child(5):hover .feature-icon {
    animation: pulse-icon 0.6s ease-in-out;
}

#features .grid > div:nth-child(6):hover .feature-icon {
    animation: shake 0.5s ease-in-out;
}

@keyframes zap {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(-10deg); }
    50% { transform: scale(0.9) rotate(10deg); }
    75% { transform: scale(1.15) rotate(-5deg); }
}

@keyframes spin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-8px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-4px); }
}

@keyframes fly {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(3px, -3px) rotate(5deg); }
    50% { transform: translate(-3px, -6px) rotate(-5deg); }
    75% { transform: translate(3px, -3px) rotate(3deg); }
}

@keyframes pulse-icon {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.8; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px) rotate(-5deg); }
    20%, 40%, 60%, 80% { transform: translateX(3px) rotate(5deg); }
}

}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 0.5rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
    overflow: hidden;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: var(--bg-light);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 8px 30px rgba(59, 130, 246, 0.6);
    }
}

@keyframes pulseGlowGreen {
    0%, 100% {
        box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
    }
    50% {
        box-shadow: 0 8px 30px rgba(16, 185, 129, 0.6);
    }
}

@keyframes pulseGlowOrange {
    0%, 100% {
        box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
    }
    50% {
        box-shadow: 0 8px 30px rgba(245, 158, 11, 0.6);
    }
}

/* How It Works Section */
.how-it-works-card:hover .how-it-works-icon:nth-child(1) {
    animation: pulseGlow 2s ease-in-out infinite;
}

.how-it-works-card:nth-child(1):hover .how-it-works-icon {
    animation: pulseGlow 2s ease-in-out infinite;
}

.how-it-works-card:nth-child(2):hover .how-it-works-icon {
    animation: pulseGlowGreen 2s ease-in-out infinite;
}

.how-it-works-card:nth-child(3):hover .how-it-works-icon {
    animation: pulseGlowOrange 2s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    nav ul {
        gap: 1rem;
    }

    .flight-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}
